<table>
	<tr id="capTabel">
		<td style="width:120px; text-align:center;">Stoc</td>
		<td style="width:120px; text-align:center;">Cod Articol</td>
		<td style="width:400px; text-align:center;">Denumire</td>
		<td style="width:80px;  text-align:center;">Pret Unitar</td>
		<td style="width:100px; text-align:center;"></td>
	</tr>
<?
	include("includes/config.php");
	include("includes/login.php");
	include("includes/functions.php");
	
	if(@$_POST['cauta']):
		$cauta =  $_POST['cauta'];
		$id_comanda = $_POST['id_comanda'];
		$nr_cmd = $_POST['nr_comanda']; 
		$id_client = $_POST['id_client'];
		$id_masina = $_POST['id_masina'];
		$nr_inmat =  $_POST['nr_inmat']; 
		$res = mysql_query("select  * from comenzi_materiale where denumire like '%$cauta%' ") or die(mysql_error());
		while($row = mysql_fetch_array($res)):
?>	
	<tr>
		<form action="" method="post">
		<td style="width:120px; text-align:center;"><input style="width:50px" type="text" name="cnt" value="<? echo $row['stoc']; ?>"></td>
		<td style="width:120px; text-align:center;"><? echo $row['cod_articol']; ?></td>
		<td style="width:400px; text-align:center;"><? echo $row['denumire']; ?></td>
		<td style="width:80px;  text-align:center;"><? echo $row['pret']; ?></td>
		<td style="width:180px; text-align:center;">
			<input type="hidden" name="articol" value="<? echo $row['denumire']; ?>">
			<input type="hidden" name="codarticol" value="<? echo $row['cod_articol']; ?>">
			<input type="hidden" name="pretu" value="<? echo $row['pret']; ?>">
			<input type="hidden" name="tva" value="<? echo $row['tva']; ?>">
			<input  class="buton" type="submit" value="Adauga" name="add_articol"/>
		</form>
		<form action="" method="post" style="float:right;padding:0;margin:0">
				<input type="hidden" name="codarticol" value="<? echo $row['cod_articol']; ?>">
			<input  class="buton" type="submit" value="Sterge" name="sterge_art"/>
		</form>
		</td>
	
		
	</tr>
	
			
<? endwhile; endif; ?>
<table>